There are 2 events fired by the Central Event System; Action and NeedObject. The Action event fires when an action is performed by the code (eg. result sorting, document reading etc). The NeedObject event fires when certain objects are created, this event allows the object type to be overridden with a subclass.
The event arguments for an Action event are of type ActionEventArgs which has a property Name. The Name specifies what action has occurred, see below for a list of names, their description and what object can be found in the ActionEventArgs.Data property.
(Please also see the Keyoti.SearchEngine.Events.ActionName type under the API documentation ('Namespaces') for a complete up to date list.)
ActionEventArgs.Name | Description |
---|---|
AutoAssignContent | The content category for a document was auto assigned, Data contains the Document object. |
AutoAssignLocation | The location category for a document was auto assigned, Data contains the Document object. |
CalculateWordRelevancies | The words have been read from a document that is being indexed and each word has been assigned a weight, Data contains the ArrayList from Document.CalculateWordRelevancies method argument. |
DocumentBeingCrawled | The crawlable links in a document are being processed, Data contains a 2 element object array - the 1st element is the Document object being crawled, and the 2nd element is an ArrayList of Uri objects found as links in the Document. |
DocumentImporterAddingDocument | A document is about to be imported from an indexable source, Data contains AddDocumentEventArgs object, which has a Cancel property to enable canceling of this action. |
DocumentIndexBuild | The index has been built, Data is null/nothing. |
DocumentIndexed | A document has been indexed, Data is the Document object. |
DiscoverLinkedURLs | New URLs have been found by reading document links, Data contains an ArrayList of string objects (the link URLs), which can be modified. |
GetWordVariations | Variations (typically lemmas via stemming) of a word are required. Data contains a 2 element object array; first element is a Word object for the word that variations are needed for, and the second element is an ArrayList of strings holding the variations. The second element can be modified as desired. |
IsDocumentToBeCrawled | The document has been checked to see if it will be crawled, Data contains IsDocumentToBeCrawledEventData and the WillCrawl property may be changed. |
IsDocumentToBeIndexed | The document has been checked to see if it will be crawled, Data contains IsDocumentToBeIndexedEventData and WillIndex property may be changed. |
ReadLinks | The links in a document have been read, Data contains ArrayList of URL strings. |
ReadText | The text in a document has been read, Data contains DocumentText object. |
ResultItemsFinalized | The search result items have been found and sorted, Data contains an ArrayList of ResultItem objects - the order and content of which may be changed. |
UseDocumentEncoding | The Encoding of a document is about to be used, Data contains the Document - the Encoding property may be read and/or set to the required value. |
The event arguments for a NeedObject event are of type NeedObjectEventArgs, which has properties;
RequiredObject: holding an object of the type needed - the instance set in RequiredObject will be used by the engine, and so this can be modified or reset with a new instance (of a sub-class for example).
Configuration: holding the current Configuration instance
Handling the NeedObject event allows sub-classes of standard types to be injected into the code. Below is a list of classes for which a NeedObject is raised.
Class | Typical Timing |
---|---|
Document | When a new Document instance is created, eg. during import and indexing. |
Reader | When a document is about to be read, eg. during import and indexing |
ParserProvider | When a document is about to be parsed into words. Provides the provider for the file type |
The list of available events will expand with subsequent versions - if you need a specific event, please email support@keyoti.com for inclusion.